package jrdcom.com.jrdcommonknowledge.Fragments.Serialize;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.ButterKnife;
import jrdcom.com.jrdcommonknowledge.R;

/**
 * Created by longcheng on 2017/3/28.
 */

public class jrdCheckFragments extends Fragment {
    public static final String TAG = jrdCheckFragments.class.getSimpleName();
    @Bind(R.id.text_check)
    TextView textCheck;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        //return super.onCreateView(inflater, container, savedInstanceState);
        View view = inflater.inflate(R.layout.layout_jrd_checkfragments, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

    }


    @Override
    public void onStart() {
        super.onStart();
        Bundle bundle = getArguments();
        SerPerson person = (SerPerson) bundle.getSerializable("Ser_person");
        if(person != null){
            textCheck.setText(person.name +person.age);
        }

        ParPerson person1 = (ParPerson) bundle.getParcelable("Par_person");
        if(person1 != null){
            textCheck.setText(person1.name +person1.age);
        }
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
